<?php
namespace app\index\controller;
use app\index\controller\BaseController;
use Curl\Curl;
use think\Config;
use think\Request;

/**
 * CRM 我的收藏
 * Class Industry
 * @package app\index\controller
 */
class CrmCollect extends BaseController{

    public function CrmCollectList(){
        $reqData['type'] = $this->request->get('type');
        $reqData['keywords'] = $this->request->get('keywords');
        $reqData['page'] = $this->request->get('page',0);
        $reqData['limit'] = $this->request->get('limit',10);
        $dispatch = $this->request->dispatch();

        if (!in_array($reqData['type'],array_keys(Config::get('collect')))){
             $this->result['status'] = -1;
             $this->result['msg'] = '参数不合法';
             return json_encode($this->result);
        }
        if (!$dispatch['user_no'] || $dispatch['user_no'] == ''){
            $this->result['status'] = -1;
            $this->result['msg'] = '';
            return json_encode($this->result);
        }
        $result = $this->getBusiness('User')->crmCollectList(Config::get('collect.'. $reqData['type']),$dispatch['user_no'],$reqData['keywords'],$reqData['page'],$reqData['limit']);
        return json_encode($result);
    }
}